// 发布订阅模式解耦 axios
class EventEmitter {
	listeners = { "API:UN_AUTH": new Set(), "API:ERROR": new Set() };

	on(eventName, listener) {
		this.listeners[eventName].add(listener);
	}

	emit(eventName, ...args) {
		this.listeners[eventName].forEach((listener) => listener(...args));
	}
}

export default new EventEmitter();
